<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template private_adaptive_pool</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../interprocess/indexes_reference.html#doxygen.boost_interprocess_header_reference.private__adaptive__pool_8hpp" title="Header &lt;boost/interprocess/allocators/private_adaptive_pool.hpp&gt;">
<link rel="prev" href="node__allocator_8hpp_1a6995dad28e5210991abe9fc9238fda39.html" title="Function template operator!=">
<link rel="next" href="structboost_1_1interprocess_1_1private__adaptive__pool_1_1rebind.html" title="Struct template rebind">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="node__allocator_8hpp_1a6995dad28e5210991abe9fc9238fda39.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../interprocess/indexes_reference.html#doxygen.boost_interprocess_header_reference.private__adaptive__pool_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="structboost_1_1interprocess_1_1private__adaptive__pool_1_1rebind.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template private_adaptive_pool</span></h2>
<p>boost::interprocess::private_adaptive_pool</p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../interprocess/indexes_reference.html#doxygen.boost_interprocess_header_reference.private__adaptive__pool_8hpp" title="Header &lt;boost/interprocess/allocators/private_adaptive_pool.hpp&gt;">boost/interprocess/allocators/private_adaptive_pool.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> SegmentManager<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> NodesPerBlock<span class="special">,</span> 
         <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> MaxFreeBlocks<span class="special">,</span> <span class="keyword">unsigned</span> <span class="keyword">char</span> OverheadPercent<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html" title="Class template private_adaptive_pool">private_adaptive_pool</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">segment_manager</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1aad85800d2fd10be94c5f8e8b74025101"></a><span class="identifier">segment_manager</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">segment_manager</span><span class="special">::</span><span class="identifier">void_pointer</span>           <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1ad7ece1642da03645fe7ba1bf9203ee1d"></a><span class="identifier">void_pointer</span><span class="special">;</span>   
  <span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">pointer</span>         <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a4bb7bf1d42a25b6a7a8c9603e9a953e4"></a><span class="identifier">pointer</span><span class="special">;</span>        
  <span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">const_pointer</span>   <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a7facf2cbc6dd77b4df09a4187ab87845"></a><span class="identifier">const_pointer</span><span class="special">;</span>  
  <span class="keyword">typedef</span> <span class="identifier">T</span>                                       <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1afa0ed5bf630317ddbc2c725fe3a12c27"></a><span class="identifier">value_type</span><span class="special">;</span>     
  <span class="keyword">typedef</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span>                             <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1acbb480cc1f66f4c010a6794e79e67429"></a><span class="identifier">reference</span><span class="special">;</span>      
  <span class="keyword">typedef</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span>                             <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1ac91bcea2540ec9a6bc8be35add231043"></a><span class="identifier">const_reference</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">segment_manager</span><span class="special">::</span><span class="identifier">size_type</span>              <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a6c12e7c7ee48e6b9dc179291f4f40fd5"></a><span class="identifier">size_type</span><span class="special">;</span>      
  <span class="keyword">typedef</span> <span class="identifier">segment_manager</span><span class="special">::</span><span class="identifier">difference_type</span>        <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a9b0934188e34602e4b18655cd03f1cd1"></a><span class="identifier">difference_type</span><span class="special">;</span>

  <span class="comment">// member classes/structs/unions</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">&gt;</span> 
  <span class="keyword">struct</span> <a class="link" href="structboost_1_1interprocess_1_1private__adaptive__pool_1_1rebind.html" title="Struct template rebind">rebind</a> <span class="special">{</span>
    <span class="comment">// types</span>
    <span class="keyword">typedef</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html" title="Class template private_adaptive_pool">private_adaptive_pool</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">SegmentManager</span><span class="special">,</span> <span class="identifier">NodesPerBlock</span><span class="special">,</span> <span class="identifier">MaxFreeBlocks</span><span class="special">,</span> <span class="identifier">OverheadPercent</span> <span class="special">&gt;</span> <a class="link" href="structboost_1_1interprocess_1_1private__adaptive__pool_1_1rebind.html#doxygen.boost_interprocess_header_reference.structboost_1_1interprocess_1_1private__adaptive__pool_1_1rebind_1a5a2862fe3cf577c4de277e890b33f679"><span class="identifier">other</span></a><span class="special">;</span>
  <span class="special">}</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#id15-bb">private member functions</a></span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">,</span> <span class="keyword">typename</span> SegmentManager2<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> N2<span class="special">,</span> 
           <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> F2<span class="special">,</span> <span class="keyword">unsigned</span> <span class="keyword">char</span> OP2<span class="special">&gt;</span> 
    <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html" title="Class template private_adaptive_pool">private_adaptive_pool</a> <span class="special">&amp;</span> 
    <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1afae487cb22dfc2026a7ce3abdfc9571d"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html" title="Class template private_adaptive_pool">private_adaptive_pool</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">SegmentManager2</span><span class="special">,</span> <span class="identifier">N2</span><span class="special">,</span> <span class="identifier">F2</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html" title="Class template private_adaptive_pool">private_adaptive_pool</a> <span class="special">&amp;</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a44e7dbfd4daba137b175bd2ec0dd091d"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html" title="Class template private_adaptive_pool">private_adaptive_pool</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#id16-bb">public member functions</a></span>
  <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a56907be7205fdc0e8b56b3edb012f3f2"><span class="identifier">private_adaptive_pool</span></a><span class="special">(</span><span class="identifier">segment_manager</span> <span class="special">*</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a0753e306cea9f54b0f5ac1c7a25fc693"><span class="identifier">private_adaptive_pool</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html" title="Class template private_adaptive_pool">private_adaptive_pool</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">&gt;</span> 
    <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a5b5a35864bec692a0aca4c88345335da"><span class="identifier">private_adaptive_pool</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html" title="Class template private_adaptive_pool">private_adaptive_pool</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">SegmentManager</span><span class="special">,</span> <span class="identifier">NodesPerBlock</span><span class="special">,</span> <span class="identifier">MaxFreeBlocks</span><span class="special">,</span> <span class="identifier">OverheadPercent</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a3eb4db45e8c23a9528bf04a5b416e96b"><span class="special">~</span><span class="identifier">private_adaptive_pool</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">node_pool_t</span> <span class="special">*</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1aba0e033cff840fd0699254847614c518"><span class="identifier">get_node_pool</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">segment_manager</span> <span class="special">*</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a6d3d869bab86e5353b05b03661bb639a"><span class="identifier">get_segment_manager</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">size_type</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a3e66cd79f85190cd0af11303abad1988"><span class="identifier">max_size</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">pointer</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1aa4dfeac65bb4bd561f018b4bc4272cb6"><span class="identifier">allocate</span></a><span class="special">(</span><span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">cvoid_pointer</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a6cc97a556a984f00238eeadf1c796d09"><span class="identifier">deallocate</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1ad5ae25ad3be7c5cfcb3d566608ac5740"><span class="identifier">deallocate_free_blocks</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">pointer</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1aa0a61f13c47fb64d1b8b67b917e655fc"><span class="identifier">address</span></a><span class="special">(</span><span class="identifier">reference</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">const_pointer</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1ae125fcc531767c91f4b70d559793682b"><span class="identifier">address</span></a><span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a5c7c51203d0a9abed37b68ae29dead66"><span class="identifier">construct</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">const_reference</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a05c17f42dde5b39fa45a9a3e8873ca06"><span class="identifier">destroy</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">size_type</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a573378d1f5153b8664eedfb11703f4fc"><span class="identifier">size</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">pointer</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1abb7f348afa10b3b743db2544048c65bc"><span class="identifier">allocation_command</span></a><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">interprocess</span><span class="special">::</span><span class="identifier">allocation_type</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">,</span> 
                             <span class="identifier">size_type</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a7db8c6fb2f548cd5079587c88f8bd3cd"><span class="identifier">allocate_many</span></a><span class="special">(</span><span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1aeb623ffb4b384d8702e3c638aea3033f"><span class="identifier">allocate_many</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">size_type</span> <span class="special">*</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a8204dc79ce5990f3dc23299f194e9c7b"><span class="identifier">deallocate_many</span></a><span class="special">(</span><span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">pointer</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a56febe8f05bfe16a32cf23623ecb00c3"><span class="identifier">allocate_one</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1af38974fe967fadb580a5ac7f69f745be"><span class="identifier">allocate_individual</span></a><span class="special">(</span><span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1af43d3b9898c9599dea1ca1557e1f8da6"><span class="identifier">deallocate_one</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a345ec1646ae3976ac565be9704bd62de"><span class="identifier">deallocate_individual</span></a><span class="special">(</span><span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="../boost_container_header_reference/classboost_1_1container_1_1devector.html#id17-bb">friend functions</a></span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a63777ee47c37b3f6817aa6fc57db0e0d"><span class="identifier">swap</span></a><span class="special">(</span><span class="identifier">self_t</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">self_t</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.16.19.3.7.4.4"></a><h2>Description</h2>
<p>An STL node allocator that uses a segment manager as memory source. The internal pointer type will of the same type (raw, smart) as "typename SegmentManager::void_pointer" type. This allows placing the allocator in shared memory, memory mapped-files, etc... This allocator has its own node pool.</p>
<p>NodesPerBlock is the minimum number of nodes of nodes allocated at once when the allocator needs runs out of nodes. MaxFreeBlocks is the maximum number of totally free blocks that the adaptive node pool will hold. The rest of the totally free blocks will be deallocated with the segment manager.</p>
<p>OverheadPercent is the (approximated) maximum size overhead (1-20%) of the allocator: (memory usable for nodes / total memory allocated from the segment manager) </p>
<div class="refsect2">
<a name="id-1.3.16.19.3.7.4.4.5"></a><h3>
<a name="id15-bb"></a><code class="computeroutput">private_adaptive_pool</code> private member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">,</span> <span class="keyword">typename</span> SegmentManager2<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> N2<span class="special">,</span> 
         <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> F2<span class="special">,</span> <span class="keyword">unsigned</span> <span class="keyword">char</span> OP2<span class="special">&gt;</span> 
  <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html" title="Class template private_adaptive_pool">private_adaptive_pool</a> <span class="special">&amp;</span> 
  <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1afae487cb22dfc2026a7ce3abdfc9571d"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html" title="Class template private_adaptive_pool">private_adaptive_pool</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">SegmentManager2</span><span class="special">,</span> <span class="identifier">N2</span><span class="special">,</span> <span class="identifier">F2</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span></pre>
<p>Not assignable from related <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html" title="Class template private_adaptive_pool">private_adaptive_pool</a> </p>
</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html" title="Class template private_adaptive_pool">private_adaptive_pool</a> <span class="special">&amp;</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a44e7dbfd4daba137b175bd2ec0dd091d"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html" title="Class template private_adaptive_pool">private_adaptive_pool</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span></pre>
<p>Not assignable from other <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html" title="Class template private_adaptive_pool">private_adaptive_pool</a> </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.16.19.3.7.4.4.6"></a><h3>
<a name="id16-bb"></a><code class="computeroutput">private_adaptive_pool</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a56907be7205fdc0e8b56b3edb012f3f2"></a><span class="identifier">private_adaptive_pool</span><span class="special">(</span><span class="identifier">segment_manager</span> <span class="special">*</span> segment_mngr<span class="special">)</span><span class="special">;</span></pre>
<p>Constructor from a segment manager. If not present, constructs a node pool. Increments the reference count of the associated node pool. Can throw <a class="link" href="classboost_1_1interprocess_1_1bad__alloc.html" title="Class bad_alloc">boost::interprocess::bad_alloc</a> </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a0753e306cea9f54b0f5ac1c7a25fc693"></a><span class="identifier">private_adaptive_pool</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html" title="Class template private_adaptive_pool">private_adaptive_pool</a> <span class="special">&amp;</span> other<span class="special">)</span><span class="special">;</span></pre>
<p>Copy constructor from other <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html" title="Class template private_adaptive_pool">private_adaptive_pool</a>. Increments the reference count of the associated node pool. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">&gt;</span> 
  <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a5b5a35864bec692a0aca4c88345335da"></a><span class="identifier">private_adaptive_pool</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html" title="Class template private_adaptive_pool">private_adaptive_pool</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">SegmentManager</span><span class="special">,</span> <span class="identifier">NodesPerBlock</span><span class="special">,</span> <span class="identifier">MaxFreeBlocks</span><span class="special">,</span> <span class="identifier">OverheadPercent</span> <span class="special">&gt;</span> <span class="special">&amp;</span> other<span class="special">)</span><span class="special">;</span></pre>
<p>Copy constructor from related <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html" title="Class template private_adaptive_pool">private_adaptive_pool</a>. If not present, constructs a node pool. Increments the reference count of the associated node pool. Can throw <a class="link" href="classboost_1_1interprocess_1_1bad__alloc.html" title="Class bad_alloc">boost::interprocess::bad_alloc</a> </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a3eb4db45e8c23a9528bf04a5b416e96b"></a><span class="special">~</span><span class="identifier">private_adaptive_pool</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Destructor, removes node_pool_t from memory if its reference count reaches to zero. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">node_pool_t</span> <span class="special">*</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1aba0e033cff840fd0699254847614c518"></a><span class="identifier">get_node_pool</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Returns a pointer to the node pool. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">segment_manager</span> <span class="special">*</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a6d3d869bab86e5353b05b03661bb639a"></a><span class="identifier">get_segment_manager</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Returns the segment manager. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">size_type</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a3e66cd79f85190cd0af11303abad1988"></a><span class="identifier">max_size</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Returns the number of elements that could be allocated. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">pointer</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1aa4dfeac65bb4bd561f018b4bc4272cb6"></a><span class="identifier">allocate</span><span class="special">(</span><span class="identifier">size_type</span> count<span class="special">,</span> <span class="identifier">cvoid_pointer</span> hint <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span></pre>
<p>Allocate memory for an array of count elements. Throws <a class="link" href="classboost_1_1interprocess_1_1bad__alloc.html" title="Class bad_alloc">boost::interprocess::bad_alloc</a> if there is no enough memory </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a6cc97a556a984f00238eeadf1c796d09"></a><span class="identifier">deallocate</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span> ptr<span class="special">,</span> <span class="identifier">size_type</span> count<span class="special">)</span><span class="special">;</span></pre>
<p>Deallocate allocated memory. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1ad5ae25ad3be7c5cfcb3d566608ac5740"></a><span class="identifier">deallocate_free_blocks</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Deallocates all free blocks of the pool </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">pointer</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1aa0a61f13c47fb64d1b8b67b917e655fc"></a><span class="identifier">address</span><span class="special">(</span><span class="identifier">reference</span> value<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Returns address of mutable object. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_pointer</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1ae125fcc531767c91f4b70d559793682b"></a><span class="identifier">address</span><span class="special">(</span><span class="identifier">const_reference</span> value<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Returns address of non mutable object. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a5c7c51203d0a9abed37b68ae29dead66"></a><span class="identifier">construct</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span> ptr<span class="special">,</span> <span class="identifier">const_reference</span> v<span class="special">)</span><span class="special">;</span></pre>
<p>Copy construct an object. Throws if T's copy constructor throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a05c17f42dde5b39fa45a9a3e8873ca06"></a><span class="identifier">destroy</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span> ptr<span class="special">)</span><span class="special">;</span></pre>
<p>Destroys object. Throws if object's destructor throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">size_type</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a573378d1f5153b8664eedfb11703f4fc"></a><span class="identifier">size</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span> p<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Returns maximum the number of objects the previously allocated memory pointed by p can hold. This size only works for memory allocated with allocate, allocation_command and allocate_many. </p>
</li>
<li class="listitem"><pre class="literallayout"><span class="identifier">pointer</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1abb7f348afa10b3b743db2544048c65bc"></a><span class="identifier">allocation_command</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">interprocess</span><span class="special">::</span><span class="identifier">allocation_type</span> command<span class="special">,</span> 
                           <span class="identifier">size_type</span> limit_size<span class="special">,</span> 
                           <span class="identifier">size_type</span> <span class="special">&amp;</span> prefer_in_recvd_out_size<span class="special">,</span> 
                           <span class="identifier">pointer</span> <span class="special">&amp;</span> reuse<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a7db8c6fb2f548cd5079587c88f8bd3cd"></a><span class="identifier">allocate_many</span><span class="special">(</span><span class="identifier">size_type</span> elem_size<span class="special">,</span> <span class="identifier">size_type</span> num_elements<span class="special">,</span> 
                   <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
<p>Allocates many elements of size elem_size in a contiguous block of memory. The minimum number to be allocated is min_elements, the preferred and maximum number is preferred_elements. The number of actually allocated elements is will be assigned to received_size. The elements must be deallocated with deallocate(...) </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1aeb623ffb4b384d8702e3c638aea3033f"></a><span class="identifier">allocate_many</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">size_type</span> <span class="special">*</span> elem_sizes<span class="special">,</span> <span class="identifier">size_type</span> n_elements<span class="special">,</span> 
                   <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
<p>Allocates n_elements elements, each one of size elem_sizes[i]in a contiguous block of memory. The elements must be deallocated </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a8204dc79ce5990f3dc23299f194e9c7b"></a><span class="identifier">deallocate_many</span><span class="special">(</span><span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
<p>Allocates many elements of size elem_size in a contiguous block of memory. The minimum number to be allocated is min_elements, the preferred and maximum number is preferred_elements. The number of actually allocated elements is will be assigned to received_size. The elements must be deallocated with deallocate(...) </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">pointer</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a56febe8f05bfe16a32cf23623ecb00c3"></a><span class="identifier">allocate_one</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Allocates just one object. Memory allocated with this function must be deallocated only with <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1af43d3b9898c9599dea1ca1557e1f8da6">deallocate_one()</a>. Throws <a class="link" href="classboost_1_1interprocess_1_1bad__alloc.html" title="Class bad_alloc">boost::interprocess::bad_alloc</a> if there is no enough memory </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1af38974fe967fadb580a5ac7f69f745be"></a><span class="identifier">allocate_individual</span><span class="special">(</span><span class="identifier">size_type</span> num_elements<span class="special">,</span> 
                         <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
<p>Allocates many elements of size == 1 in a contiguous block of memory. The minimum number to be allocated is min_elements, the preferred and maximum number is preferred_elements. The number of actually allocated elements is will be assigned to received_size. Memory allocated with this function must be deallocated only with <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1af43d3b9898c9599dea1ca1557e1f8da6">deallocate_one()</a>. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1af43d3b9898c9599dea1ca1557e1f8da6"></a><span class="identifier">deallocate_one</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span> p<span class="special">)</span><span class="special">;</span></pre>
<p>Deallocates memory previously allocated with <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a56febe8f05bfe16a32cf23623ecb00c3">allocate_one()</a>. You should never use deallocate_one to deallocate memory allocated with other functions different from <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a56febe8f05bfe16a32cf23623ecb00c3">allocate_one()</a>. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a345ec1646ae3976ac565be9704bd62de"></a><span class="identifier">deallocate_individual</span><span class="special">(</span><span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
<p>Allocates many elements of size == 1 in a contiguous block of memory. The minimum number to be allocated is min_elements, the preferred and maximum number is preferred_elements. The number of actually allocated elements is will be assigned to received_size. Memory allocated with this function must be deallocated only with <a class="link" href="classboost_1_1interprocess_1_1private__adaptive__pool.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1af43d3b9898c9599dea1ca1557e1f8da6">deallocate_one()</a>. </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.16.19.3.7.4.4.7"></a><h3>
<a name="id17-bb"></a><code class="computeroutput">private_adaptive_pool</code> friend functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__adaptive__pool_1a63777ee47c37b3f6817aa6fc57db0e0d"></a><span class="identifier">swap</span><span class="special">(</span><span class="identifier">self_t</span> <span class="special">&amp;</span> alloc1<span class="special">,</span> <span class="identifier">self_t</span> <span class="special">&amp;</span> alloc2<span class="special">)</span><span class="special">;</span></pre>
<p>Swaps allocators. Does not throw. If each allocator is placed in a different memory segment, the result is undefined. </p>
</li></ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2005-2024 Ion Gaztanaga<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="node__allocator_8hpp_1a6995dad28e5210991abe9fc9238fda39.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../interprocess/indexes_reference.html#doxygen.boost_interprocess_header_reference.private__adaptive__pool_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="structboost_1_1interprocess_1_1private__adaptive__pool_1_1rebind.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
